//
//  ManagerAFNetWorking.h
//  TaoLeSong
//
//  Created by EmberWei on 2017/07/03.
//  Copyright © 2017年 LimeKing. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>


typedef void (^HttpHandler)(id result, NSError *error);

@interface HttpObject : NSObject

// POST请求
+ (NSURLSessionTask *)POST:(NSString *)urlString parameters:(id)parameters responseClass:(Class)responseClass handler:(HttpHandler)handler;

// GET请求
+ (NSURLSessionTask *)GET:(NSString *)urlString parameters:(id)parameters responseClass:(Class)responseClass handler:(HttpHandler)handler;

// PATCH请求
+ (NSURLSessionTask *)PATCH:(NSString *)urlString parameters:(id)parameters responseClass:(Class)responseClass handler:(HttpHandler)handler;

// PUT请求
+ (NSURLSessionTask *)PUT:(NSString *)urlString parameters:(id)parameters responseClass:(Class)responseClass handler:(HttpHandler)handler;


// DELETE请求
+ (NSURLSessionTask *)DELETE:(NSString *)urlString parameters:(id)parameters responseClass:(Class)responseClass handler:(HttpHandler)handler;


//上传头像
+ (NSURLSessionTask *)POST:(NSString *)URLString parameters:(id)parameters
 constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))block
                  progress:(void (^)(NSProgress *))uploadProgress
             responseClass:(Class)responseClass
                   handler:(HttpHandler)handler;
@end


@interface ManagerAFNetWorking : AFHTTPSessionManager
+ (ManagerAFNetWorking *)manager;
+ (void)json;
+ (void)form;
@end




